<style>
    .layui-table-cell {
        padding:1px 3px;
        height:auto;
        overflow:visible;
        text-overflow:inherit;
        white-space:normal;
        word-break: break-all;line-height:19px;
    }
    .analytics th{padding:3px 6px;font-weight:bold;}
    .bold{font-weight:bold;}
    th .layui-table-cell{text-align:center;font-size:13px;line-height:19px;}
    .layui-form-item .shotselect{width:120px;}
    .layui-form-pane .layui-form-label{width:auto;}
    .layui-layer-btn{margin-bottom: 40px;}
    .layui-form-item{margin-bottom: 0px;}
    .hover{color: blue}
</style>

    <div class=" fixed-bar">
        <form class="layui-form layui-form-pane fixed-bar-form" action="{:url()}" method="get" id="hisi-table-search">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">订单号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="client_ordernum" lay-verify="" placeholder="输入订单号" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline removeStat">
                    <label class="layui-form-label">SKU</label>
                    <div class="layui-input-inline">
                        <input type="text" name="sku" lay-verify="" placeholder="输入SKU" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">来源帐号</label>
                    <div class="layui-input-inline">
                        {:Form::select('is_auto_import', '', [''=> '请选择']+config('mimo.order_from'), '', '')}
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">订单状态</label>
                    <div class="layui-input-inline">
                        {:Form::select('order_status', '', ['' => '请选择', 1=>'未采购', 2=>'已采购', 3=>'已裁床', 4=>'已车缝', 5=>'已后整', 6=>'已出货', 7=>'已完成', 99=>'已废弃', 999=>'MES废除'], '', '')}
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">面辅二次工艺单价</label>
                    <div class="layui-input-inline">
                        <input type="text" name="special_process_a_unitprice" value="0" lay-verify="number" placeholder="输入" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">搜索</button>
                </div>
            </div>

    </div>


<div class="layui-collapse">
    <div class="layui-colla-item caigou">
        <h2 class="layui-colla-title"></h2>
        <div class="layui-colla-content layui-show">
            <div>节点筛选：
                {if $Request.controller == 'PriceDiscuss' &&  $Request.action == 'index'}
                <a href="{:url('mp/PriceDiscuss/index')}" class="layui-btn layui-btn-sm layui-btn-normal">待审核</a>
                {else /}
                <a href="{:url('mp/PriceDiscuss/index')}" class="layui-btn layui-btn-sm layui-btn-primary">待审核</a>
                {/if}
                {if $Request.controller == 'PriceDiscuss' &&  $Request.action == 'indexruning'}
                》<a href="{:url('mp/PriceDiscuss/indexRuning')}" class="layui-btn layui-btn-sm layui-btn-normal">进行中</a>
                {else /}
                》<a href="{:url('mp/PriceDiscuss/indexRuning')}" class="layui-btn layui-btn-sm layui-btn-primary">进行中</a>
                {/if}
                {if $Request.controller == 'PriceDiscuss' &&  $Request.action == 'indexfinish'}
                》<a href="{:url('mp/PriceDiscuss/indexFinish')}" class="layui-btn layui-btn-sm layui-btn-normal">已完成</a>
                {else /}
                》<a href="{:url('mp/PriceDiscuss/indexFinish')}" class="layui-btn layui-btn-sm layui-btn-primary">已完成</a>
                {/if}
            </div>
        </div>
    </div>
</div>

<table id="dataTable"  lay-filter="dataTable"></table>

{include file="system@block/layui" /}

<script type="text/html" title="操作按钮模板" id="buttonTpl">
    <a href="{:url('audit')}?status={{ d.status }}&client_ordernum={{ d.client_ordernum }}" title="审核" class="layui-btn layui-btn-sm hisi-ajax layui-btn-warm" confirm="您确定要执行该操作吗？" refresh="false" callback="callbackAudit">审核</a>

    <!--    <a href="{:url('edit')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-normal hisi-iframe" hisi-data="{width: '470px', height: '600px'}" title="修改组别">修改</a>-->
<!--    <a href="{:url('status?val=0')}?id={{ d.id }}" class="layui-btn layui-btn-xs layui-btn-danger j-tr-del">删除</a>-->
</script>

<script type="text/html" title="排序模板" id="sortTpl">
    <input type="text" class="layui-input hisi-ajax-input input-sort" onkeyup="value=value.replace(/[^\d]/g,'')" value="{{ d.order }}" data-value="{{ d.id }}" data-href="{:url('sort')}?id={{ d.id }}&field=order">
</script>

<script type="text/html" id="toolbar">
    <div class="layui-btn-group fl">
<!--        <a href="{:url('add')}" class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-add-circle-fine hisi-iframe" hisi-data="{width: '470px', height: '600px'}" title="添加组别">&nbsp;添加</a>-->
<!--        <a data-href="{:url('status?val=0')}" class="layui-btn layui-btn-primary layui-btn-sm j-page-btns confirm layui-icon layui-icon-close red">&nbsp;删除</a>-->
    </div>
</script>

<script type="text/html" id="updateTimeTpl">
    <div>{{layui.util.toDateString(d.update_time * 1000) }}</div>
</script>
<script src="__PUBLIC_JS__/jquery.2.1.4.min.js?v={:config('hisiphp.version')}"></script>
<script src="__PUBLIC_JS__/xm-select/dist/xm-select.js?v={:config('hisiphp.version')}"></script>
<script src="__PUBLIC_JS__/vue@3.2.26/dist/vue.global.js"></script>
<script type="text/javascript">
    layui.use(['table', 'tool', 'form'], function() {
        var table = layui.table;
        var form = layui.form;
        table.render({
            elem: '#dataTable'
            ,url: '{:url()}' //数据接口
            ,page: true //开启分页
            ,skin: 'row'
            ,even: true
            ,limit: 20
            ,limits: [20,50,100,150,200]
            ,text: {
                none : '暂无相关数据'
            }
            ,toolbar: '#toolbar'
            ,defaultToolbar: ['filter', 'exports', 'print']
            ,cols: [[ //表头
                {type:'checkbox', fixed:'left'}
                ,{field: 'is_auto_import_txt', title: '来源'}
                ,{field: 'create_time', title: '下单时间'}
                ,{field: 'client_ordernum', title:'订单号',templet:function(d){ return'<span class="copy-item">'+d.client_ordernum+'</span>'}}
                ,{field: 'sku', title:'SKU',templet:function(d){ return'<span class="copy-item">'+d.sku+'</span>'}}
                ,{field: 'order_status_txt', title: '订单状态'}
                ,{field: 'ft_name', title: '工厂'}
                ,{field: 'special_process_a_name', title: '面辅二次工艺名称'}
                ,{field: 'special_process_a_unitprice', title: '面辅二次工艺单价'}
                ,{field: 'username', title: '操作人'}
                // ,{field: 'update_time', title: '更新时间',templet: '#updateTimeTpl'}
                // ,{field: 'order', title: '排序', templet: '#sortTpl'}
                ,{title: '操作', templet: '#buttonTpl', fixed: 'right'}
            ]]
        });
        //触发行双击事件
        table.on('rowDouble(dataTable)', function(obj){
            //obj 同上
            // console.log(obj);
            if($(obj.tr.selector).attr('style')=="background:#00968882;"){
                $(obj.tr.selector).removeAttr('style');
            }else{
                $(obj.tr.selector).attr({"style":"background:#00968882;"});
            }
        });

        // 审核回调
        window.callbackAudit = function(obj, res) {
            if (res.code == 1) {
                obj.remove();
            }
        }
    });


</script>